//
//  DJMessageFansCell.m
//  daojiVideo
//
//  Created by tikeios_002 on 2024/5/22.
//

#import "DJMessageFansCell.h"
@interface DJMessageFansCell ()
@property (weak, nonatomic) IBOutlet UIImageView *userImage;

@property (weak, nonatomic) IBOutlet UILabel *userName;
@property (weak, nonatomic) IBOutlet UILabel *message;
@property (weak, nonatomic) IBOutlet UILabel *time;

@end
@implementation DJMessageFansCell

- (void)showOldAddNavViewToMainOldView1{
    UIView * oldBgSS = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    oldBgSS.clipsToBounds = YES;
    [self addSubview:oldBgSS];
    
    UIButton * sendBtn = [[UIButton alloc]initWithFrame:CGRectMake(KScreen_W-75, kStatusBarHeight+10, 60, 46)];
    sendBtn.layer.cornerRadius = 3;
    sendBtn.backgroundColor = [UIColor whiteColor];
    [sendBtn setTitle:@"发送" forState:UIControlStateNormal];
    [sendBtn setTitleColor:ColorHex(@"#333333") forState:UIControlStateNormal];
    sendBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [sendBtn addTarget:self action:@selector(sendTap) forControlEvents:UIControlEventTouchUpInside];
    [oldBgSS addSubview:sendBtn];
    
    UIView * sendBg = [[UIView alloc]initWithFrame:CGRectMake(15, kStatusBarHeight+66, KScreen_W-30, (KScreen_H-KSafeAreaBottomHeight-25-(kStatusBarHeight+66))/2)];
    sendBg.backgroundColor = [UIColor whiteColor];
    sendBg.layer.cornerRadius = 3;
    [oldBgSS addSubview:sendBg];
    
    UILabel * sendTip = [[UILabel alloc]initWithFrame:CGRectMake(0, (sendBg.frame.size.height-40)/2, sendBg.frame.size.width, 40)];
    sendTip.text = @"发送区";
    sendTip.textColor = ColorHex(@"#f0f0f0");
    sendTip.textAlignment = NSTextAlignmentCenter;
    sendTip.font = [UIFont systemFontOfSize:28];
    [sendBg addSubview:sendTip];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    UIImageView * showTextViewImgTo2 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 60, 60)];
    showTextViewImgTo2.hidden = YES;
    showTextViewImgTo2.layer.cornerRadius = K_AUTOLAYOUT_W(30);
    showTextViewImgTo2.clipsToBounds = YES;
    showTextViewImgTo2.contentMode = UIViewContentModeScaleAspectFill;
    [self addSubview:showTextViewImgTo2];
    
    UILabel * showTextViewLabelTo2 = [[UILabel alloc]initWithFrame:CGRectMake(15, 35, KScreen_W-30, 30)];
    showTextViewLabelTo2.hidden = YES;
    showTextViewLabelTo2.font = FontBold(18);
    showTextViewLabelTo2.textColor = ThreeColor;
    showTextViewLabelTo2.textAlignment = NSTextAlignmentCenter;
    [self addSubview:showTextViewLabelTo2];
    // Initialization code
}
- (void)showCell:(NSDictionary *)dic{
    [self.userImage sd_setImageWithURL:KUrlString(dic[@"face"]) placeholderImage:KImageNamed(@"ic_head_defuls")];
    self.userName.text = dic[@"nickname"];
    self.message.text = dic[@"msg"];
    self.time.text = dic[@"createtime"];
    if([dic[@"isfollow"] intValue] == 1){
        [self.followButton setTitle:NSLocalizedString(@"互关", nil) forState:UIControlStateNormal];
        self.followButton.layer.borderWidth = 1;
        self.followButton.layer.borderColor = MainColor.CGColor;
        self.followButton.backgroundColor = [UIColor clearColor];
    }else{
        [self.followButton setTitle:NSLocalizedString(@"回关", nil) forState:UIControlStateNormal];
        self.followButton.layer.borderWidth = 0;
        self.followButton.backgroundColor = MainColor;
    }
}
- (void)showTextViewSubViewToViewTo2:(UIView * )subView{

    UIView * showTextViewSubViewTo2 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    showTextViewSubViewTo2.clipsToBounds = YES;
    [subView addSubview:showTextViewSubViewTo2];
    UILabel * showTextViewSubViewLabelTo3 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
    showTextViewSubViewLabelTo3.text = @"ppppp88888";
    [showTextViewSubViewTo2 addSubview:showTextViewSubViewLabelTo3];
    
    UIImageView * showTextViewSubViewTo3 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
    [subView addSubview:showTextViewSubViewTo3];

}
@end
